<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script type="text/javascript" src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/vue/2.6.14/vue.min.js"></script><script type="text/javascript" src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/element-ui/2.15.7/index.min.js"></script><link rel="stylesheet" href="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/element-ui/2.15.7/theme-chalk/index.min.css" />
    <meta name="author" content="lijinbo" />
    <title>045-文件转base64</title>
    <script type="module" crossorigin src="../../../../static/js/045-index.html-144edd46.js"></script>
    <link rel="modulepreload" crossorigin href="../../../../static/common/modulepreload-polyfill-3cfb730f.js">
    <link rel="modulepreload" crossorigin href="../../../../static/common/page-53f648eb.js">
  </head>

  <body>
    <div id="app">
      <p>文件转base64</p>
      <div class="box">
        <input type="file" @change="selectFile" />
      </div>
      <el-divider></el-divider>
      <div>
        <el-button type="primary" @click="copy">复制到剪切板</el-button>
        <el-button type="success" @click="base64FileDown">base64文件下载</el-button>
      </div>
      <el-divider></el-divider>
      <el-image style="width: 50px" v-if="isImage" :src="base64" :preview-src-list="[base64]"></el-image>
      <el-input v-model="base64" type="textarea" :rows="5"></el-input>
    </div>

    
  </body>
</html>
